<!DOCTYPE html>
<html lang="zh-CN" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layout/default">
<head>
    <meta charset="UTF-8">
    <title>字典管理</title>
    <script>
        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<div layout:fragment="content" th:remove="tag">

    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                字典管理
                <small>维护系统中的基础数据，该数据会在其他模块中用到。</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
<!--                 <li class="btn-group"> -->
<!--                     <button type="button" class="btn blue dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" -->
<!--                             data-delay="1000" data-close-others="true"> -->
<!--                         <span>跳转</span> <i class="fa fa-angle-down"></i> -->
<!--                     </button> -->
<!--                     <ul class="dropdown-menu pull-right" role="menu"> -->
<!--                         <li><a th:href="@{/sys/dict}">字典列表</a></li> -->
<!--                         <li><a th:href="@{/sys/dict/form}">字典添加</a></li> -->
<!--                     </ul> -->
<!--                 </li> -->
                <li>
                    <i class="fa fa-home"></i>
                    <a th:href="@{/}">首页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">系统设置</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li><a href="#">字典管理</a></li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->

        </div>
    </div>


    <div class="row profile">
        <div class="col-md-12">
            <!--BEGIN TABS-->
            <div class="tabbable tabbable-custom tabbable-full-width">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#dict_tab_1_1">字典列表</a></li>
                    <li><a th:href="@{/sys/dict/form}">字典添加</a></li>
                </ul>
                <div class="tab-content">

                    <div class="tab-pane active" id="dict_tab_1_1">
                        <div class="row search-form-default">
                            <div class="col-md-12">
                                <form id="userSearchForm" th:object="${dict}"
                                           th:action="@{/sys/dict/}" method="post"
                                           class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <input id="orderBy" name="orderBy" type="hidden" value="${page.orderBy}"/>

                                    <div class="form-group">
                                        <label for="type">类型：</label>
                                        <select th:field="*{type}" class="form-control input-medium" >
                                            <option value="" label=""></option>
                                            <option th:each="item : ${typeList}" th:value="${item}" th:label="${item}"></option>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label for="description">描述：</label>
                                        <input th:field="*{description}" class="form-control input-medium"/>
                                    </div>
                                    <button type="button" class="btn green" onclick="return page();">
                                        搜索 &nbsp;<i class="m-icon-swapright m-icon-white"></i>
                                    </button>

                                </form>
                            </div>
                        </div>

                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-advance table-hover">
                                <thead>
                                <tr>
                                    <th>键值</th>
                                    <th>标签</th>
                                    <th>类型</th>
                                    <th>描述</th>
                                    <th>排序</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                    <tr th:each="item : ${page.list}">
                                        <td th:text="${item.value}">value</td>
                                        <td><a th:href="@{/sys/dict/form(id=${item.id})}" th:text="${item.label}">loginName</a></td>
                                        <td><a href="javascript:" onclick="$('#type').val('[[${item.type}]]');$('#searchForm').submit();return false;" th:text="${item.type}">type</a></td>
                                        <td th:text="${item.description}">description</td>
                                        <td th:text="${item.sort}">sort</td>
                                        <td>
                                            <a class="btn default btn-xs blue-stripe" th:href="@{/sys/dict/form(id=${item.id})}">修改</a>
                                            <a class="btn default btn-xs red-stripe" th:href="@{/sys/dict/delete(id=${item.id})}"
                                               onclick="return App.confirm('确认要删除该字典吗？', this.href)">删除</a>
                                            <a class="btn default btn-xs green-stripe" th:href="@{/sys/dict/form/(type=${item.type},sort=${item.sort+10},description=${item.description})}" >添加键值</a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="row margin-top-20">
                            <th:block th:utext="${page}"/>
                        </div>

                </div>
            </div>
        </div>
    </div>


</div>


</body>
</html>
